import request from '@/utils/request'
enum API {
  ALLPERMISSION_URL = '/admin/acl/permission',
  ADDMENU_URL = '/admin/acl/permission/save',
  UPDATEMENU_URL = '/admin/acl/permission/update',
  REMOVEMENU_URL = '/admin/acl/permission/remove/'
}
export const reqAllPermission = () => {
  return request.get<any, any>(API.ALLPERMISSION_URL)
}
export const reqAddOrUpdateMenu = (data: any) => {
  if (data.id) {
    return request.put<any, any>(API.UPDATEMENU_URL, data)
  } else {
    return request.post<any, any>(API.ADDMENU_URL, data)
  }
}
export const reqRemoveMenu = (id: string) => {
  return request.delete(API.REMOVEMENU_URL + `${id}`)
}
